/**
 * yeahmobi.com Inc.
 * Copyright © 2014 YeahMobi | All Rights Reserved.
 */   
    
package com.ndp.fb.mq.service.schedulerservice;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.dubbo.config.annotation.Service;
import com.ndp.fb.mq.api.service.schedulerservice.FBUserSchedulerService;
import com.ndp.fb.rdb.api.FbUserRdbService;
import com.ndp.fb.rdb.model.FbUser;

/**
 * @Title: FBUserSchedulerServiceImpl.java
 * @Copyright: Copyright © 2015
 * @Description: 
 * @Company: yeahmobi
 * @Created on 下午1:25:47
 * @author giser.yang
 */
@Service
public class FBUserSchedulerServiceImpl implements FBUserSchedulerService {

	@Reference
	FbUserRdbService fbUserRdbService;
	/** 
	 * @discription
	 * @author giser.yang       
	 * 创建时间 2015年6月19日 下午1:25:47      
	 * @param fbUserId
	 * @return     
	 * @see FBUserSchedulerService#getUserTokenByFbUserId(java.lang.Long)
	 */

	@Override
	public FbUser getFbUserByFbUserId(Long fbUserId) {
		return fbUserRdbService.getFbUserFromCache(fbUserId);
	}

	/** 
	 * @discription
	 * @author giser.yang       
	 * 创建时间 2015年6月19日 下午1:31:25      
	 * @param fbUserId
	 * @return     
	 * @see FBUserSchedulerService#getUserTokenByFbUserId(java.lang.Long)
	 */  
	    
	@Override
	public String getUserTokenByFbUserId(Long fbUserId) {
		FbUser fbUser = this.getFbUserByFbUserId(fbUserId);
		if(fbUser!=null){
			return fbUser.getAccessToken();
		}
		return null;
	}

}
